﻿using Oplug.EntityFramework.RossLive;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;

namespace Oplug.Services
{
    public class OplugLiveService : IDisposable
    {
        public OplugLiveDbContext dbContext;
        public OplugLiveService(string ConnStr)
        {
            dbContext = new OplugLiveDbContext(ConnStr);
        }
        public int RunSqlCommand(string Keywords)
        {
            var param1 = new SqlParameter { ParameterName = "Keywords", Value = Keywords, Direction = ParameterDirection.Input };
            return dbContext.Database.ExecuteSqlCommand("exec Proc_CopyPartFL @Keywords", param1);
        }

        public void Dispose()
        {
            dbContext.Dispose();
        }
    }
}
